﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="frmDefault.aspx.cs" Inherits="Apa.Forms.frmDefault" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Gridview Add, Edit and Delete</title>

    <link rel="stylesheet" type="text/css" href="jquery.ganttView-master/lib/jquery-ui-1.8.4.css" />
	<link rel="stylesheet" type="text/css" href="jquery.ganttView-master/diagrama/reset.css" />
	<link rel="stylesheet" type="text/css" href="jquery.ganttView-master/jquery.ganttView.css" />
	<style type="text/css">
		body {
			font-family: tahoma, verdana, helvetica;
			font-size: 0.8em;
			padding: 10px;
		}
	</style>


    <style>
    
    
    /* #### bootstrap Form #### */
.bootstrap-frm {
   
    margin-right:auto;

    max-width: 500px;
    background: #FFF;
    padding: 20px 30px 20px 30px;
    font: 12px "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: #888;
    text-shadow: 1px 1px 1px #FFF;
    
    border-radius: 5px;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
}
.bootstrap-frm h1 {
    font: 25px "Helvetica Neue", Helvetica, Arial, sans-serif;
    padding: 0px 0px 10px 40px;
    display: block;
    border-bottom: 1px solid #DADADA;
    margin: -10px -30px 30px -30px;
    color: #888;
}
.bootstrap-frm h1>span {
    display: block;
    font-size: 11px;
}
.bootstrap-frm .label {
    display: block;
    margin: 0px 0px 5px;
}
.bootstrap-frm label>span {
    float: left;
    width: 20%;
    text-align: right;
    padding-right: 10px;
    margin-top: 10px;
    color: #333;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: bold;
}
.bootstrap-frm input[type="text"],input[type="email"],input[type="number"],input[type="password"],input[type="date"], .bootstrap-frm input[type="email"], .bootstrap-frm textarea, .bootstrap-frm select{
    border: 1px solid #CCC;
    color: #888;
    height: 20px;
    line-height:15px;
    margin-bottom: 16px;
    margin-right: 6px;
    margin-top: 2px;
    outline: 0 none;
    padding: 5px 0px 5px 5px;
    width: 70%;
    border-radius: 4px;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;    
    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}



.bootstrap-frm select {
    background: #FFF url('down-arrow.png') no-repeat right;
    background: #FFF url('down-arrow.png') no-repeat right;
    appearance:none;
    -webkit-appearance:none; 
    -moz-appearance: none;
    text-indent: 0.01px;
    text-overflow: '';
    width: 70%;
    height: 35px;
    line-height:15px;
}
.bootstrap-frm textarea{
    height:100px;
    padding: 5px 0px 0px 5px;
    width: 70%;
}
.bootstrap-frm .button {
    background: #FFF;
    border: 1px solid #CCC;
    padding: 10px 25px 10px 25px;
    color: #333;
    border-radius: 4px;
}
.bootstrap-frm .button:hover {
    color: #333;
    background-color: #EBEBEB;
    border-color: #ADADAD;
}
    
    </style>

<script type="text/javascript">
    function deleteConfirm(pubid) {
        var result = confirm('Do you want to delete ' + pubid + ' ?');
        if (result) {
            return true;
        }
        else {
            return false;
        }
    }
</script>
</head>
<body>
    <form id="form1" runat="server" class="bootstrap-frm">

    <label>

 <h1>Cronograma de actividades. <span>Cronograma que permite agregar o actualizar fechas de actividades.</span>
    </h1>
</label>


<div>
<asp:GridView ID="gridView" DataKeyNames="idDetalle" runat="server" Width="100%"
        AutoGenerateColumns="false" ShowFooter="true" HeaderStyle-Font-Bold="true"
        onrowcancelingedit="gridView_RowCancelingEdit"
        onrowdeleting="gridView_RowDeleting"
        onrowediting="gridView_RowEditing"
        onrowupdating="gridView_RowUpdating"
        onrowcommand="gridView_RowCommand"
        OnRowDataBound="gridView_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="idDetalle" Visible="false">
    <ItemTemplate>
        <asp:Label ID="txtidDetalle" runat="server" Text='<%#Eval("idDetalle") %>'/>
    </ItemTemplate>
    <EditItemTemplate>
        <asp:Label ID="lblidDetalle" runat="server" width="40px" Text='<%#Eval("idDetalle") %>'/>
    </EditItemTemplate>
    <FooterTemplate>
        <asp:TextBox ID="inidDetalle" width="40px" runat="server"/>
           </FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Actividad">
    <ItemTemplate>
        <asp:Label ID="txtActividad" runat="server" Text='<%#Eval("Actividad") %>'/>
    </ItemTemplate>
    <EditItemTemplate>
        <asp:Label ID="lblActividad" runat="server" width="200px" Text='<%#Eval("Actividad") %>'/>
    </EditItemTemplate>
    <FooterTemplate>
        <asp:TextBox ID="inActividad" width="200px" runat="server" required/>
        <asp:RequiredFieldValidator ID="vActividad" runat="server" ControlToValidate="inActividad" Text="?" ValidationGroup="validaiton"/>
    </FooterTemplate>
</asp:TemplateField>

<asp:TemplateField HeaderText="FechaIncioProgramada">
<ItemTemplate>
<asp:Label ID="lblFecha2" runat="server" Text='<%#Eval("fechaInicioPlan") %>'/>
</ItemTemplate>
    <EditItemTemplate>
         <asp:TextBox ID="txtFechaIncioProgramada" width="200px"  runat="server" Text='<%#Eval("fechaInicioPlan") %>'  type="Date" required/>
     </EditItemTemplate>
    <FooterTemplate>
        <asp:TextBox ID="inFechaIncioProgramada" width="200px"  runat="server" type="Date"/>
    </FooterTemplate>
     </asp:TemplateField>

<asp:TemplateField HeaderText="FechaFinProgramada">
<ItemTemplate>
<asp:Label ID="lblFecha" runat="server" Text='<%#Eval("fechaFinPlan") %>'/>
</ItemTemplate>
    <EditItemTemplate>
         <asp:TextBox ID="txtFechaFinProgramada" width="200px"  runat="server" Text='<%#Eval("fechaFinPlan") %>'  type="Date" required/>
     </EditItemTemplate>
    <FooterTemplate>
        <asp:TextBox ID="inFechaFinProgramada" width="200px"  runat="server" type="Date"/>
    </FooterTemplate>
     </asp:TemplateField>


     
<asp:TemplateField HeaderText="FechaInicioReal">
<ItemTemplate>
<asp:Label ID="lblFecha3" runat="server" Text='<%#Eval("FechaInicioReal") %>'/>
</ItemTemplate>
    <EditItemTemplate>
         <asp:TextBox ID="txtFechaInicioReal" width="200px"  runat="server" Text='<%#Eval("FechaInicioReal") %>'  type="Date" required/>
     </EditItemTemplate>
    <FooterTemplate>
        <asp:TextBox ID="inFechaInicioReal" width="200px"  runat="server" type="Date"/>
    </FooterTemplate>
     </asp:TemplateField>

<asp:TemplateField HeaderText="FechaFinReal">
<ItemTemplate>
<asp:Label ID="lblFecha4" runat="server" Text='<%#Eval("FechaFinReal") %>'/>
</ItemTemplate>
    <EditItemTemplate>
         <asp:TextBox ID="txtFechaFinReal" width="200px"  runat="server" Text='<%#Eval("FechaFinReal") %>'  type="Date" required/>
     </EditItemTemplate>
    <FooterTemplate>
        <asp:TextBox ID="inFechaFinReal" width="200px"  runat="server" type="Date"/>
    </FooterTemplate>
     </asp:TemplateField>


<asp:TemplateField HeaderText="Peso">
      <ItemTemplate>
         <asp:Label ID="lblPeso" runat="server" Text='<%#Eval("Peso") %>'/>
     </ItemTemplate>
     <EditItemTemplate>
         <asp:TextBox ID="txtPeso" width="70px"  runat="server" Text='<%#Eval("Peso") %>'/>
     </EditItemTemplate>
     <FooterTemplate>
         <asp:TextBox ID="inPeso"  width="120px" runat="server"/>
         <asp:RequiredFieldValidator ID="vPeso" runat="server" ControlToValidate="inPeso" Text="?" ValidationGroup="validaiton"/>
     </FooterTemplate>
</asp:TemplateField>


<asp:TemplateField HeaderText="Indicador">
      <ItemTemplate>
         <asp:Label ID="lblIndicador" runat="server" Text='<%#Eval("Indicador") %>'/>
     </ItemTemplate>
     <EditItemTemplate>
         <asp:TextBox ID="txtIndicador" width="70px"  runat="server" Text='<%#Eval("Indicador") %>'/>
     </EditItemTemplate>
     <FooterTemplate>
         <asp:TextBox ID="inIndicador"  width="120px" runat="server"/>
         <asp:RequiredFieldValidator ID="vIndicador" runat="server" ControlToValidate="inIndicador" Text="?" ValidationGroup="validaiton"/>
     </FooterTemplate>
</asp:TemplateField>


  

<asp:TemplateField HeaderText="Responsable">
      <ItemTemplate>
         <asp:Label ID="lblResponsable" runat="server" Text='<%#Eval("Responsable") %>'/>
     </ItemTemplate>
     <EditItemTemplate>
         <asp:TextBox ID="txtResponsable" width="70px"  runat="server" Text='<%#Eval("Responsable") %>'/>
     </EditItemTemplate>
     <FooterTemplate>
         <asp:TextBox ID="inResponsable"  width="120px" runat="server"/>
         <asp:RequiredFieldValidator ID="vResponsable" runat="server" ControlToValidate="inResponsable" Text="?" ValidationGroup="validaiton"/>
     </FooterTemplate>
</asp:TemplateField>




<asp:TemplateField HeaderText="Cargo">
      <ItemTemplate>
        <asp:Label ID="lblCargo" runat="server" Text='<%#Eval("Cargo") %>'/>
     </ItemTemplate>
     <EditItemTemplate>
         <asp:TextBox ID="txtCargo" width="70px"  runat="server" Text='<%#Eval("Cargo") %>'/>
     </EditItemTemplate>
     <FooterTemplate>
         <asp:TextBox ID="inCargo"  width="120px" runat="server"/>
         <asp:RequiredFieldValidator ID="vCargo" runat="server" ControlToValidate="inCargo" Text="?" ValidationGroup="validaiton"/>
     </FooterTemplate>
</asp:TemplateField>





<asp:TemplateField HeaderText="Meta">
      <ItemTemplate>
         <asp:Label ID="lblMeta" runat="server" Text='<%#Eval("Meta") %>'/>
     </ItemTemplate>
     <EditItemTemplate>
         <asp:TextBox ID="txtMeta" width="70px"  runat="server" Text='<%#Eval("Meta") %>'/>
     </EditItemTemplate>
     <FooterTemplate>
         <asp:TextBox ID="inMeta"  width="120px" runat="server"/>
         <asp:RequiredFieldValidator ID="vMeta" runat="server" ControlToValidate="inMeta" Text="?" ValidationGroup="validaiton"/>
     </FooterTemplate>
</asp:TemplateField>




<asp:TemplateField HeaderText="Descripcion">
      <ItemTemplate>
         <asp:Label ID="lblDescripcion" runat="server" Text='<%#Eval("Descripcion") %>'/>
     </ItemTemplate>
     <EditItemTemplate>
         <asp:TextBox ID="txtDescripcion" width="70px"  runat="server" Text='<%#Eval("Descripcion") %>'/>
     </EditItemTemplate>
     <FooterTemplate>
         <asp:TextBox ID="inDescripcion"  width="120px" runat="server"/>
         <asp:RequiredFieldValidator ID="vDescripcion" runat="server" ControlToValidate="inDescripcion" Text="?" ValidationGroup="validaiton"/>
     </FooterTemplate>
</asp:TemplateField>

  <asp:TemplateField HeaderText="Recursos">
      <ItemTemplate>
         <asp:Label ID="lblRecursos" runat="server" Text='<%#Eval("Recursos") %>'/>
     </ItemTemplate>
     <EditItemTemplate>
         <asp:TextBox ID="txtRecursos" width="70px"  runat="server" Text='<%#Eval("Recursos") %>'/>
     </EditItemTemplate>
    <FooterTemplate>
         <asp:TextBox ID="inRecursos"  width="120px" runat="server"/>
         <asp:RequiredFieldValidator ID="vRecursos" runat="server" ControlToValidate="inRecursos" Text="?" ValidationGroup="validaiton"/>
     </FooterTemplate>
</asp:TemplateField>


  <asp:TemplateField HeaderText="Otro">
      <ItemTemplate>
         <asp:Label ID="lblOtro" runat="server" Text='<%#Eval("Otro") %>'/>
     </ItemTemplate>
     <EditItemTemplate>
         <asp:TextBox ID="txtOtro" width="70px"  runat="server" Text='<%#Eval("Otro") %>'/>
     </EditItemTemplate>
     <FooterTemplate>
         <asp:TextBox ID="inOtro"  width="120px" runat="server"/>
         <asp:RequiredFieldValidator ID="vOtro" runat="server" ControlToValidate="inOtro" Text="?" ValidationGroup="validaiton"/>
     </FooterTemplate>
</asp:TemplateField>

 <asp:TemplateField>
    <EditItemTemplate>
        <asp:Button ID="ButtonUpdate" runat="server" CommandName="Update"  Text="Update"  />
        <asp:Button ID="ButtonCancel" runat="server" CommandName="Cancel"  Text="Cancel" />
    </EditItemTemplate>
    <ItemTemplate>
        <asp:Button ID="ButtonEdit" runat="server" CommandName="Edit"  Text="Edit"  />
        <asp:Button ID="ButtonDelete" runat="server" CommandName="Delete"  Text="Delete"  />
    </ItemTemplate>
    <FooterTemplate>
        <asp:Button ID="ButtonAdd" runat="server" CommandName="AddNew"  Text="Add New Row" ValidationGroup="validaiton" />
    </FooterTemplate>
 </asp:TemplateField>
</Columns>
</asp:GridView>
    </div>
<div >
<br />&nbsp;&nbsp;&nbsp;&nbsp;


<label>
<asp:Label ID="lblmsg" runat="server"></asp:Label>
</label>

<br />
<br />
<label>

 <h1>Diagrama de actividades. <span>Diagrama de gantt que permite visualizar las 
     fechas de las actividades.</span>
    </h1>
</label>
     
</div>
    </form>


    	<div id="ganttChart"></div>
	<br/><br/>
	<div id="eventMessage"></div>

	<script type="text/javascript" src="jquery.ganttView-master/lib/jquery-1.4.2.js"></script>
	<script type="text/javascript" src="jquery.ganttView-master/lib/date.js"></script>
	<script type="text/javascript" src="jquery.ganttView-master/lib/jquery-ui-1.8.4.js"></script>
	<script type="text/javascript" src="jquery.ganttView-master/jquery.ganttView.js"></script>
	<%--<script type="text/javascript" src="jquery.ganttView-master/diagrama/data.js"></script>--%>
    <script type="text/javascript" src="jquery.ganttView-master/diagrama/jsonResult.aspx"></script>
	<script type="text/javascript">
	    $(function () {
	        $("#ganttChart").ganttView({
	            data: ganttData,
	            slideWidth: 900,
	            behavior: {
	                onClick: function (data) {
	                    var msg = "You clicked on an event: { start: " + data.start.toString("M/d/yyyy") + ", end: " + data.end.toString("M/d/yyyy") + " }";
	                    $("#eventMessage").text(msg);
	                },
	                onResize: function (data) {
	                    var msg = "You resized an event: { start: " + data.start.toString("M/d/yyyy") + ", end: " + data.end.toString("M/d/yyyy") + " }";
	                    $("#eventMessage").text(msg);
	                },
	                onDrag: function (data) {
	                    var msg = "You dragged an event: { start: " + data.start.toString("M/d/yyyy") + ", end: " + data.end.toString("M/d/yyyy") + " }";
	                    $("#eventMessage").text(msg);
	                }
	            }
	        });

	        // $("#ganttChart").ganttView("setSlideWidth", 600);
	    });
	</script>


</body>
</html>

